<script>
    $("div[name='up-connect']").mouseover(function () {
        var up_content = $(this).html();
        var content_list = up_content.split('##');
        str_html = '';
        for (i = 0; i < content_list.length; i++) {
            str_html += "<p>" + content_list[i] + "</p>";
        }
        $(this).popover({
            trigger: "hover",
            placement: "right",
            html: true,
            content: str_html,
        });
        $(this).popover('show');
    });

    //搜索
    $("#search-key").bind('change',function () {
        var key = $(this).val();
        if (key != "" ) {
            var url = "/log/searchtk/" + key + "/";

        }else{
            var url = "/log/task/";
        }
        $("#search-a").attr("href", url);
    });

    $("a[name='check-task-log']").click(function () {
        var id = $(this).attr("task_id");
        $.ajax({
            type: "post",
            async:false,
            url: "/log/taskret/",
            data: {"id":id},
            dataType : "json",
            success: function(data) {
                $("#task-log").empty();
                $("#task-log").append(data);
                $("#taskModal").modal('show');
            },
            error:function (data) {
                spop({
                    template:data.responseText,
                    style: 'error',
                    autoclose: 2000
                });
            }
        });

    });

    //3分钟自动刷新一次页面
    setTimeout(function(){location.reload()},60000);

</script>